/*
 * @Author: zhanglianchang
 * @Date: 2020-08-01 14:39:32
 * @Last Modified by: taoshiwei
 * @Last Modified time: 2019-04-29 14:57:26
 *
 * 标签有关的接口：自己写吧~~  已经被张老师删了 ^_^
 */

// 添加标签
import { createAPI } from '@/utils/request'
class Tag {
    // 标签列表
    list = data => createAPI('/tags', 'get', data)

    // 标签简单列表
    simple = data => createAPI('/tags/simple', 'get', data)

    // 标签详情
    detail = data => createAPI(`/tags/${data.id}`, 'get', data)

    // 标签添加
    add = data => createAPI('/tags', 'post', data)

    // 标签修改
    update = data => createAPI(`/tags/${data.id}`, 'put', data)

    // 标签删除
    remove = data => createAPI(`/tags/${data.id}`, 'delete', data)

    // 标签状态
    changeState = data => createAPI(`/tags/${data.id}/${data.state}`, 'post', data)
}

export default new Tag()